<template>
	<view>
		<u-navbar title="启动充电" :autoBack="false" @leftClick="back"></u-navbar>
		<!-- <view @click='test'>测试弹窗</view> -->
		<cardtd :ChargeCar="ChargeCar" :Station="Station" :ChargeUser="ChargeUser" v-model="td" @tderr="tderr"
			:cddxtype="cddxtype"></cardtd>
		<parkfee :data="Station" :user='USearch' :gtel="packGtel"></parkfee>
		<cardje ref="cardje" :ChargeCar="ChargeCar" v-model="je" v-show="!cddxtype"></cardje>
		<yycd ref="yycd" :gtel="gtel" @change='handleyycd' v-if='ChargeCar.gtype == 62 && StationHD.b_caryy == 1'>
		</yycd>
		<cardzf ref="cardzf" :ChargeCar="ChargeCar" v-model="type" v-show="!cddxtype"></cardzf>
		<fixedbtn>
			<u-button type="primary" :loading="loading" @click="zffn()" text="去支付"></u-button>
		</fixedbtn>
		<cdxz ref="cdxz14" :ChargeCar="ChargeCar" v-if='isShowTips'></cdxz>
		<zmodal ref="zmodal"></zmodal>

	</view>
</template>

<script>
	import cardtd from "./components/cardtd.vue";
	import cardje from "./components/cardje.vue";
	import cardzf from "./components/cardzf.vue";
	import parkfee from "./components/cardParkFee.vue"
	import yycd from "./components/yycd.vue"
	import cdjson from "./sys";
	import config from "@/config/index.js";
	import qs from "qs";
	import cdxz from "./components/cdxz.vue";
	import chargecar14 from "./mixins/chargecar14.vue";
	export default {
		name: "Chargecar",
		components: {
			parkfee,
			cardtd,
			cardje,
			cardzf,
			cdxz,
			yycd
		},
		mixins: [chargecar14],
		data() {
			return {
				isShowTips: false,
				loading: false,
				zftext: this.$z.$t("去支付"),
				query: {
					gtel: "",
					td: ""
				},
				gtel: "",
				td: "",
				je: 0,
				type: "",
				ChargeCar: {},
				backdata: {},
				ChargeUser: [],
				reqdata: {},
				Station: {},
				show: false,
				orders: [{
						sjc: '2024-02-02 12:03',
						gtel: '12345678945',
						td: '1',
					},
					{
						sjc: '2024-02-02 12:03',
						gtel: '12345678945',
						td: '1',
					},
					{
						sjc: '2024-02-02 12:03',
						gtel: '12345678945',
						td: '2',
					},
				],
				parkingLockType: '',
				openChargeType: 0,
				parkingLockOrder: '',
				backType: 0,
				isShowParkingLockOrderSys: false,
				isChargeOrderSys: false,
				isChargeOrderSysObj: {},
				isUnpaidOrderObj: {},
				isParkingLockOrderObj: {},
				ChargeCarSys: {},
				yycdObj: {},
				StationHD: {},
				USearch: {},
				packGtel: '',
			};
		},
		async onLoad(query) {
			this.openChargeType = query.openChargeType ? query.openChargeType : 0
			console.log('this.openChargeType', this.openChargeType)
			this.backType = query.backType ? query.openChargeType : 0
			this.packGtel = query.gtel
			query = query.gtel.split("_");
			if (query.length >= 2) {
				query.gtel = query[0];
				query.td = query[1];
			} else {
				query.gtel = query[0];
				query.td = "0";
			}
			this.gtel = query.gtel;
			let ChargeCar = await this.$z.request("/ChargeCarSys", {
				gtel: this.gtel
			});

			if (ChargeCar[0].gls == 1 && query.td == "0") {
				query.td = 1
				this.td = 1
			}
			this.td = query.td;

			console.log('this.packGtel', this.packGtel)
			if (!this.$store.state.user.USearch.uUser) {
				await this.$store.dispatch("user/getuser");
			}
			let USearch = this.$store.state.user.USearch;
			this.query = query;
			await this.searchUserOrder()
			await this.getParkingLock(query.gtel)
			if (!USearch.utel || USearch.utel == "") {
				this.$refs.zmodal.init({
					title: '提示',
					content: `请您完善信息后继续充电`,
					confirm() {
						uni.reLaunch({
							url: `/pages/ChargeCarSys/Uedtuteladd/Uedtuteladd?gtel=${query.gtel}_${query.td}`,
						});
					}
				})
			} else if (this.isShowParkingLockOrderSys && this.isParkingLockOrderObj && this.isParkingLockOrderObj
				.gtel !=
				this.gtel) {
				this.$refs.zmodal.init({
					title: '提示',
					content: `系统检测到您当前有一笔占位订单，待占位订单结束后再重新扫码进行充电`,
					confirm() {
						uni.reLaunch({
							url: "/pages/order/order"
						})
					}
				})
			} else if (this.isUnpaidOrderObj && this.isUnpaidOrderObj.b_zf == 0) {
				this.$refs.zmodal.init({
					content: this.$z.$t("系统检测到您当前存在未缴纳的占位订单，请支付后再使用。"),
					showcancel: false,
					showconfirm: true,
					title: this.$z.$t("温馨提示"),
					confirmText: this.$z.$t("打开占位订单"),
					confirm: () => {
						uni.reLaunch({
							url: `/pages/order/components/components/placeholderOrderInfo?ddh=${this.isUnpaidOrderObj.ddh}&gtel=${query.gtel}_${query.td}&type=sys`
						})
					},
					cancel: () => {}
				});

			} else if (this.parkingLockType == 14 && this.openChargeType != 1) {

				uni.reLaunch({
					url: `/pages/parkingLock/parkingLock?gtel=${this.gtel}_${this.td}`,
				})
			} else {
				await this.init()
			}

		},
		onShow() {
			if (this.backdata.type == "recharge") {
				this.backdata.type = "";
				this.fkfn();
			}
		},
		methods: {
			handleyycd(val) {

				this.yycdObj = val
			},
			async searchUserOrder() {
				if (!this.$store.state.user.USearch.uUser) {
					await this.$store.dispatch("user/getuser");
				}
				let USearch = this.$store.state.user.USearch;
				let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
					uUser: USearch.uUser,
				});
				let ChargeUser = await this.$z.request("/ChargeUser", {
					uUser: USearch.uUser,
				});
				this.isShowParkingLockOrderSys = ChargeUserDs.some(item => item.b_end == 0);
				this.isChargeOrderSys = ChargeUser.some(item => item.b_end == 0);
				this.isParkingLockOrderObj = ChargeUserDs.find(item => item.b_end == 0);
				this.isChargeOrderSysObj = ChargeUser.find(item => item.b_end == 0);
				this.isUnpaidOrderObj = ChargeUserDs.find(item => item.b_zf == 0 && item.b_end == 1)

			},
			async basecofig() {
				if (!this.$store.state.user.USearch.uUser) {
					await this.$store.dispatch("user/getuser");
				}
				let USearch = this.$store.state.user.USearch;

				if (!USearch.utel || USearch.utel == "") {
					this.$refs.zmodal.init({
						title: '提示',
						content: `请您完善信息后继续充电`,
						confirm() {
							uni.navigateTo({
								url: `/pages/ChargeCarsys/Uedtuteladd/Uedtuteladd?gtel=${this.gtel}_${this.td}`,
							});
						}
					})
					return;
				}
			},
			async back() {
				// uni.navigateTo({
				// 	url: `/pages/order/order`
				// })
				// let minje = this.query.minje || 0;
				// let USearch = await this.$store.dispatch("user/getuser");

				if (this.backType) {
					uni.reLaunch({
						url: `/pages/parkingLock/parkingLock?gtel=${this.gtel}_${this.td}`
					})
				}
				this.$z.back();
			},
			async test(val) {
				let ChargeCarSys = await this.$z.request("/ChargeCarSys", {
					gtel: val,
				});
				ChargeCarSys = ChargeCarSys[0]
				if (ChargeCarSys.type == 14) {

				}
			},
			// 查询是否有地锁订单
			async seachParkingLockOrder() {
				let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
					gtel: this.gtel,
				});

				// 使用some检查是否存在未结束订单
				this.isParkingLockOrder = ChargeUserDs.some(item => item.b_end == 0);

			},
			// 查看是否为地锁设备
			async getParkingLock(val) {
				let ChargeCarSys = await this.$z.request("/ChargeCarSys", {
					gtel: val,
				});
				this.ChargeCarSys = ChargeCarSys[0]
				this.parkingLockType = this.ChargeCarSys.type
			},
			open() {
				this.show = true

			},
			close() {
				this.show = false

			},
			handleClick(order) {

			},
			async init() {
				this.ChargeUser = await this.$z.request("/ChargeUser");

				if (!this.$store.state.user.USearch.uUser) {
					await this.$store.dispatch("user/getuser");
				}
				let USearch = this.$store.state.user.USearch;
				this.USearch = USearch
				let ChargeCar = await this.$z.request("/ChargeCarSys", {
					gtel: this.gtel,
				});
				let StationHD = await this.$z.request("/StationHD", {
					id: ChargeCar[0].pcs,
				});
				this.StationHD = StationHD[0]

				this.ChargeCarSys = ChargeCar[0]
				if (ChargeCar[0].gcdl3 == 2) {
					this.$refs.zmodal.init({
						title: '提示',
						content: `急停已被按下，请顺时针旋转急停按钮恢复使用`,
						confirm() {
							uni.reLaunch({
								url: "/pages/home1/home1"
							})
						}
					})

					return;
				}
				if (
					this.ChargeCarSys.b_whitelist != "0" &&
					!(!this.USearch.utel || this.USearch.utel == "")
				) {
					let WhiteList = await this.$z.request("/WhiteList", {
						utel: this.USearch.utel,
						type: this.ChargeCarSys.b_whitelist == 1 ? "0" : "1",
						pcs: this.ChargeCarSys.pcs,
					});
					let errstr = "";
					if (this.ChargeCarSys.b_whitelist == 1 && (WhiteList.length == 0 || WhiteList[0].b_use == 0)) {
						errstr = "此设备启用白名单功能，您不在白名单内，请联系设备管理员！！";
					} else if (this.ChargeCarSys.b_whitelist == 2 && WhiteList.length != 0) {
						errstr =
							"此设备启用黑名单功能，您已被加入黑名单，请联系设备管理员！！";
					}
					if (errstr != "") {
						this.$refs.zmodal.init({
							content: errstr,
							confirm: () => {
								this.$z.sys();
							},
						});
						return;
					}
				}
				let errstr = "";

				if (ChargeCar.length == 0) {
					errstr = this.$z.$t("设备查询失败");
				} else {
					let gtel = await this.$z.request("/gtel", {
						gtel: this.gtel,
					});
					ChargeCar = {
						xtype: gtel[0]?.xtype,
						...ChargeCar[0]
					};
					if (!["1", "12", "14"].includes(String(ChargeCar.type))) {
						errstr = this.$z.$t("不支持此收费模式");
					} else if (ChargeCar.gzt != "1") {
						errstr = this.$z.$t("设备不在线");
					}
				}
				this.ChargeCar = ChargeCar;

				if (errstr) {
					console.log('errstr', errstr)
					this.isShowTips = false
					this.loading = true
					// this.$refs.cdxz14.close()
					this.$refs.zmodal.init({
						content: errstr,
						confirm: () => {
							this.$z.sys();
						},
					});
					return;
				}
				// let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
				// 	gtel: this.gtel,
				// 	td:
				// });
				// console.log('地锁订单', ChargeUserDs);

				let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
					uUser: USearch.uUser,
				});
				let ChargeUser = await this.$z.request("/ChargeUser", {
					uUser: USearch.uUser,
				});
				let isShowParkingLockOrder = ChargeUserDs.some(item => item.b_end == 0);
				let isChargeOrder = ChargeUser.some(item => item.b_end == 0);
				if (isShowParkingLockOrder && isChargeOrder) {
					this.$refs.zmodal.init({
						title: '提示',
						content: `系统检测到您当前有一笔占位订单，待占位订单结束后再重新扫码进行充电`,
						confirm() {
							uni.reLaunch({
								url: "/pages/home1/home1"
							})
						}
					})
					return
				}

				if (USearch.printid && USearch.printid != "") {
					await this.$store.dispatch("request/clearRequest", {
						url: "/Card",
						data: {
							printid: USearch.printid,
						},
					});
				}
				this.ChargeCar = ChargeCar;
				if (ChargeCar.pcs) {
					let Station = await this.$z.request("/StationCar", {
						id: ChargeCar.pcs,
					});
					this.Station = Station[0] || {}
				}

				if (this.ChargeCar.b_pm == 6 && !USearch.ccp) {
					this.$refs.zmodal.init({
						title: '提示',
						content: this.$z.$t("请绑定车牌"),
						showcancel: true,
						confirm: () => {
							// type 扫码页面 传入类型
							uni.navigateTo({
								url: `/pages/userccp/userccp?gtel=${this.gtel}_${this.td}&type=1`
							})
						},
						cancel: () => {
							uni.navigateTo({
								url: `/pages/home1/home1`
							})
						},
					});
				}
			},
			tderr() {
				this.loading = true
				this.$refs.zmodal.init({
					content: this.$z.$t("此设备无可用充电通道请选择其他设备充电！！"),
					confirm: () => {
						this.$z.sys();
					},
				});
			},
			async zffn() {
				if (this.td == "0") {
					this.$refs.zmodal.init({
						content: this.$z.$t("请选择通道"),
					});
					return;
				}
				console.log('this.yycdObj', this.yycdObj)

				if (this.yycdObj.b_yy === 1 && (!this.yycdObj.sjyys || !this.yycdObj.sjyye)) {
					this.$refs.zmodal.init({
						content: this.$z.$t("请选择预约时间"),
					});
					return;
				}
				if (this.yycdObj.b_yy == 1 && !this.yycdObj.isValid) {
					this.$refs.zmodal.init({
						content: this.$z.$t("请选择正确的预约时间"),
					});
					return;
				}
				await this.zfjsonfn();
			},
			sbzt(dqChargeCardata) {
				console.log('到这了吗', dqChargeCardata)
				if (dqChargeCardata["gtype"] == "62") {
					if (dqChargeCardata.gls == 4) {
						return dqChargeCardata["gczt" + this.reqdata.td] == "0" ?
							false : true;
					} else {
						return dqChargeCardata["gcdl" + this.reqdata.td] == "0" ?
							true :
							false;
					}

				}
				if (dqChargeCardata.gtype == 2 && dqChargeCardata.gcdl5 == "1") {
					return dqChargeCardata["glzt" + this.reqdata.td] == 0 ? true : false;
				}

				return true;
			},
			async zfjsonfn() {
				let dqzffs = cdjson
					.find((e) => {
						return e.type.includes(String(this.ChargeCar.type));
					})
					.zffs.find((e) => {
						if (this.cddxtype) {
							return e.selected == "";
						}
						return e.selected == this.type;
					});
				let reqdata = {};
				let USearch = this.$store.state.user.USearch;

				dqzffs.data.forEach((e) => {
					if (e == "gtel") {
						reqdata.gtel = this.gtel;
					} else if (e == "td") {
						reqdata.td = this.td;
					} else if (e == "je") {
						//如果试预约充电订单 需要把预约超时的金额也加上
						if (this.yycdObj.b_yy == 1) {
							reqdata.je = this.je + this.yycdObj.fee
						} else {
							reqdata.je = this.je;
						}
					} else if (e == "printid") {
						reqdata.printid = USearch.printid;
					} else if (e == "uUser") {
						reqdata.uUser = USearch.uUser;
					} else if (e == "b_yy") {
						reqdata.b_yy = this.yycdObj.b_yy;
					} else if (e == "sjyys") {
						reqdata.sjyys = this.yycdObj.sjyys;
					} else if (e == "sjyye") {
						reqdata.sjyye = this.yycdObj.sjyye;
					} else if (e == "jeyy") {
						reqdata.jeyy = this.yycdObj.fee;
					}

				});
				console.log('reqdata11', reqdata, dqzffs);
				// b_yy == 1 是预约充电
				if (this.yycdObj.b_yy != 1) {
					['b_yy', 'sjyys', 'jeyy', 'sjyye'].forEach(field => delete reqdata[field]);
				}

				this.reqdata = reqdata;
				if (!this.cddxtype) {
					let ChargeCarSys = await uni.$z.request("/ChargeCarSys", {
						gtel: this.ChargeCar.gtel,
					});
					ChargeCarSys = ChargeCarSys.length == 1 ? ChargeCarSys[0] : {};
					if (this.sbzt(ChargeCarSys)) {
						var cqtd = parseInt(this.reqdata.td) + 2;
						if (ChargeCarSys["gcdl" + cqtd] == "0") {
							this.$u.toast(this.$z.$t("设备未插枪无法充电"));
							return Promise.reject(this.$z.$t("设备未插枪无法充电"));
						}
					} else {
						this.$u.toast(this.$z.$t("当前通道被占用"));
						return Promise.reject(this.$z.$t("当前通道被占用"));
					}
				}
				// 判断是否为地锁模式

				let zffs = this.$refs.cardzf.zffs;

				let haswxzfb = zffs.find((e) => {
					return e.type == "wx" || e.type == "zfb";
				});

				if (this.type == "USearch") {
					let yeerrstr = "",
						confirmText = "",
						cancelText = "";
					if (USearch.je < reqdata.je) {
						yeerrstr = this.$z.$t("余额不足是否充值");
						confirmText = this.$z.$t("去充值");
						cancelText = this.$z.$t("否");
						this.$refs.zmodal.init({
							content: yeerrstr,
							showcancel: true,
							confirmText: confirmText,
							cancelText: cancelText,
							confirm: () => {
								uni.navigateTo({
									url: `/pages/recharge/recharge`,
								});
							},
							cancel: () => {
								// if (haswxzfb) {
								// 	let cardzf = this.$refs.cardzf;
								// 	cardzf.itemtap(cardzf.zffs[0]);
								// 	this.zffn();
								// }
							},
						});
					} else if (USearch.je <= 100) {
						yeerrstr = this.$z.$t("余额小于1元是否充值，是否充值?");
						confirmText = this.$z.$t("是");
						cancelText = this.$z.$t("否");
						title: '提示',
							this.$refs.zmodal.init({
								content: yeerrstr,
								showcancel: true,
								confirmText: confirmText,
								cancelText: cancelText,
								confirm: () => {
									uni.navigateTo({
										url: `/pages/recharge/recharge`,
									});
								},
								cancel: () => {
									this.reqfn();
								},
							});
					} else {
						this.reqfn();
					}
				} else if (this.type == "Card") {
					let card = await this.$store.dispatch("request/getRequest", {
						url: "/Card",
						data: {
							printid: USearch.printid,
						},
					});
					card = card[0] || {
						je: 0,
					};

					if (card.type == 5) {
						if (card.je <= 0 || !card.je) {
							this.$refs.zmodal.init({
								content: this.$z.$t("您的剩余分钟不足"),
							});
						} else {
							this.reqfn();
						}
					} else if ([1, 3, 4, 6].indexOf(Number(card.type)) >= 0) {
						if (card.je <= 0 || !card.je) {
							this.$refs.zmodal.init({
								content: this.$z.$t("您的剩余次数不足"),
							});
						} else {
							this.reqfn();
						}
					} else {
						// console.log(card,reqdata);
						if (card.je < reqdata.je || card.je == 0) {
							this.$refs.zmodal.init({
								title: '提示',
								content: this.$z.$t("卡余额不足是否充值"),
								showcancel: true,

								confirmText: this.$z.$t("去充值"),
								cancelText: this.$z.$t("取消"),
								confirm: () => {
									uni.navigateTo({
										url: `/pages/card/pay/pay?printid=${card.printid}&minje=${reqdata.je}`,
									});
								},
								cancel: () => {
									// if (haswxzfb) {
									// 	let cardzf = this.$refs.cardzf;
									// 	cardzf.itemtap(cardzf.zffs[0]);
									// 	this.zffn();
									// }
								},
							});
						} else if (card.je < 100) {
							this.$refs.zmodal.init({
								title: '提示',
								content: this.$z.$t("卡余额小于1元是否充值，是否充值?"),
								showcancel: true,
								confirmText: this.$z.$t("是"),
								cancelText: this.$z.$t("否"),
								confirm: () => {
									uni.navigateTo({
										url: `/pages/card/pay/pay?printid=${card.printid}&minje=${reqdata.je}`,
									});
								},
								cancel: () => {
									this.reqfn();
								},
							});
						} else {
							this.reqfn();
						}
					}
				} else {
					this.reqfn();
				}
			},
			// 检测账号。降地锁和扫码充电用户是否为一个用户
			handleSameAccount() {
				this.$refs.zmodal.init({
					title: '温馨提示',
					content: `急停已被按下，请顺时针旋转急停按钮恢复使用`,
					confirm: () => {
						uni.reLaunch({
							url: "/pages/home1/home1"
						})

					}
				})
			},
			async reqfn() {
				let dqzffs = cdjson
					.find((e) => {
						return e.type.includes(String(this.ChargeCar.type));
					})
					.zffs.find((e) => {
						if (this.cddxtype) {
							return e.selected == "";
						}
						return e.selected == this.type;
					});
				let reqdata = {};
				let USearch = this.$store.state.user.USearch;
				dqzffs.data.forEach((e) => {
					if (e == "gtel") {
						reqdata.gtel = this.gtel;
					} else if (e == "td") {
						reqdata.td = this.td;
					} else if (e == "je") {
						if (this.yycdObj.b_yy == 1) {
							reqdata.je = this.je + this.yycdObj.fee
						} else {
							reqdata.je = this.je;
						}
					} else if (e == "printid") {
						reqdata.printid = USearch.printid;
					} else if (e == "uUser") {
						reqdata.uUser = USearch.uUser;
					} else if (e == "b_yy") {
						reqdata.b_yy = this.yycdObj.b_yy;
					} else if (e == "sjyys") {
						reqdata.sjyys = this.yycdObj.sjyys;
					} else if (e == "sjyye") {
						reqdata.sjyye = this.yycdObj.sjyye;
					} else if (e == "jeyy") {
						reqdata.jeyy = this.yycdObj.fee;
					}
				});
				if (this.yycdObj.b_yy != 1) {
					['b_yy', 'sjyys', 'jeyy', 'sjyye'].forEach(field => delete reqdata[field]);
				}
				console.log('dqzffs123', dqzffs, USearch, reqdata);
				this.reqdata = reqdata;
				if (dqzffs.selected == "wx" || dqzffs.selected == "zfb") {
					await uni.$z.pay(dqzffs.url, reqdata);
					this.zfokfn();
					return;
				}
				// 查询是否有地锁订单
				let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
					uUser: USearch.uUser,
				});

				// 查找未结束订单
				const unfinishedOrder = ChargeUserDs.find(item => item.b_end == 0);

				if (!unfinishedOrder && this.ChargeCar.type == 14) {
					this.$refs.zmodal.init({
						content: this.$z.$t("系统检测到您当前没有打开地锁，请打开地锁后再充电"),
						showcancel: false,
						showconfirm: true,
						title: this.$z.$t("温馨提示"),
						confirmText: this.$z.$t("打开地锁"),
						confirm: () => {
							uni.navigateTo({
								url: `/pages/parkingLock/parkingLock?gtel=${this.reqdata.gtel}`,
							})
						},
						cancel: () => {}
					});
					return
				}
				let par = await uni.$z.request(dqzffs.url, reqdata);
				if (typeof par == "string") {
					window.location.href = par;
				} else if (["/CCBCD", "/CCBCDxc", "/CCBCar"].indexOf(dqzffs.url) >= 0) {
					window.location.href = par[0].par;
				} else if (par[0].par == "err_repeat" && this.yycdObj.b_yy == 1) {
					this.$refs.zmodal.init({
						content: this.$z.$t(`当前站点每天最多可取消预约${this.yycdObj.caryycs}次，当前可取消预约0次，请明天再预约充电`),
						showcancel: false,
						showconfirm: true,
						title: this.$z.$t("提示"),
						confirm: () => {},
						cancel: () => {}
					});
				} else if (par[0].par == "succeed") {
					uni.showToast({
						title: this.$z.$t("操作成功"),
						duration: 2000,
						icon: "none",
					});
					// // 地锁下降后，充电后 调用接口与后台保持对应

					// let ChargeUserDsToUseradd = await this.$z.request("/ChargeUserDsToUseradd", {
					// 	ddhds: this.gtel,
					// });
					this.zfokfn();
				} else {
					let str = config.pars[par[0].par] || this.$z.$t("该通道已被占用");
					if (str == "错误") {
						str = "当前卡为固定站点消费卡，不支持此站点使用。"
					} else if (par[0].par == "err_gnoreg" && reqdata.printid) {
						str = "当前卡为固定站点消费卡，不支持此站点使用。"
					}
					this.$refs.zmodal.init({
						content: str,
					});
				}
			},
			zfokfn() {

				this.reqdata.paramsUrl = '/ChargeAsk';
				let page = "";

				if (this.ChargeCar.b_ask == 1) {
					page = `/pages/ChargeAsk/ChargeAsk?${qs.stringify(this.reqdata)}`;
				} else {
					page = `/pages/ChargeUser/ChargeUser`;
				}

				// // console.log(qs.stringify(
				// // 	this.reqdata
				// // ));
				uni.redirectTo({
					url: page,
				});
			},
		},
	};
</script>

<style lang="scss">
	.box {
		padding: 40rpx;
		display: flex;
		// justify-content: space-between;
	}

	.order-list {
		padding: 32rpx;
	}

	.order-title {
		font-size: 42rpx;
		color: #1989fa;
		font-weight: bold;
		margin-right: 10rpx;
		margin-bottom: 10rpx;
	}



	.order-time {
		font-size: 36rpx;
	}

	.order-footer {
		display: flex;
		justify-content: space-between;
		margin-top: 10rpx;
	}

	.order-label {
		font-size: 36rpx;
		color: #333;
	}

	.order-green {
		font-size: 32rpx;
		color: #1f8800
	}

	.order-orange {
		font-size: 32rpx;
		color: #ff4600
	}

	page {
		background-color: $uni-bg-color-grey;
	}

	.card {
		margin: 30rpx 30rpx;
		background: #fff;
	}
</style>